#include <cstdio>

//direct = 1 means direct to right, else -1 means left
struct ball_info {
    int direct;
    int position;
} ball_data[100];

//L_data[i] means there is(are) i ball(s) in position i
int L_data[1001];

int main(int argc, char const* argv[])
{
    int n, L, t;
    scanf("%d %d %d", &n, &L, &t);

    for (int i = 0; i <= L; i++)
        L_data[i] = 0;

    for (int i = 0; i < n; i++) {
        int start_position;
        scanf("%d", &start_position);
        ball_data[i].direct = 1;
        ball_data[i].position = start_position;
        L_data[start_position]++;
    }

    for (int i = 0; i < t; i++) {
        for (int j = 0; j < n; j++) {
            L_data[ball_data[j].position]--;
            ball_data[j].position += ball_data[j].direct;
            L_data[ball_data[j].position]++;
            if (ball_data[j].position == 0 || ball_data[j].position == L)
                ball_data[j].direct *= -1;
        }

        for (int j = 0; j <= L; j++) {
            int count = 0;
            if (L_data[j] == 2) {
                for (int k = 0; k < n; k++) {
                    if (ball_data[k].position == j) {
                        ball_data[k].direct *= -1;
                        count++;
                    }
                    if (count == 2)
                        break;
                }
            }
        }
    }

    for (int i = 0; i < n; i++) {
        if (i == 0)
            printf("%d", ball_data[i].position);
        else
            printf(" %d", ball_data[i].position);
    }
    return 0;
}